﻿// Copyrights (c) 2017 GlassGrass

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;



namespace GlassGrass.Unity.GuiFramework
	{
	/// <summary> Flexible space. </summary>
	/// <remarks>
	///     <para> In manual mode this class do nothing. </para>
	///     <para> In auto mode this class uses GUILayout.FlexibleSpace. </para>
	/// </remarks>
	public class FlexibleSpace : GuiElement
		{
		/// <summary> Create FlexibleSpace instance. </summary>
		/// <param name="config"></param>
		public FlexibleSpace(GuiConfig config) : base(config)
			{
			}

		/// <summary> Define what to choose style for this from skin. </summary>
		/// <param name="skin"></param>
		/// <returns></returns>
		protected override GUIStyle ChooseStyle(GUISkin skin)
			=> skin.box;



		/// <summary> Define how to layout manually itself on rendering frame. </summary>
		/// <param name="parentSkin"></param>
		public override void LayoutManual(GUISkin parentSkin)
			{
			}



		/// <summary> Define how to layout automatically itself on rendering frame.  </summary>
		/// <param name="parentSkin"></param>
		public override void LayoutAuto(GUISkin parentSkin)
			=> GUILayout.FlexibleSpace();

		}
	}
